function [CBest, etaBest, ResultBest, CSecondBest, etaSecondBest, ResultSecondBest] = Ddavid_MLR_GL_find_parameter_by_cross_validation(SampledDataTraining, UnSampledDataTraining, SampledOnlyTrueLabelTraining, CMin, CMax, CStep, etaMin, etaMax, etaStep, NFold, Msg)

CBest = CMin;
CSecondBest = CMin;
etaBest = etaMin;
etaSecondBest = etaMin;
ResultBest.HammingLoss = 1.0;
ResultSecondBest.HammingLoss = 1.0;

CTemp = CMin;
while CTemp <= CMax
    etaTemp = etaMin;
    while etaTemp <= etaMax
        if(Msg == true)
            disp(['Ddavid_MLR_GL_find_parameter_by_cross_validation C = ' num2str(CTemp) ', eta = ' num2str(etaTemp)]);
        end
        
        [Result] = Ddavid_MLR_GL_cross_validation(SampledDataTraining, UnSampledDataTraining, SampledOnlyTrueLabelTraining, CTemp, etaTemp, NFold, false);
        
        if(Result.HammingLoss < ResultBest.HammingLoss)
            CSecondBest = CBest;
            etaSecondBest = etaBest;
            ResultSecondBest = ResultBest;
            CBest = CTemp;
            etaBest = etaTemp;
            ResultBest = Result;
        end

        if(Msg == true)
            disp(['Ddavid_MLR_GL_find_parameter_by_cross_validation C = ' num2str(CTemp) ', eta = ' num2str(etaTemp) ', HammingLoss = ' num2str(Result.HammingLoss), ', BestHammingLoss = ' num2str(ResultBest.HammingLoss)]);
        end
        
        etaTemp = etaTemp * etaStep;
    end
    
    CTemp = CTemp * CStep;
end
